import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-09-27
 * Time: 10:43
 */
public class Test {
    public static void main(String[] args) {
        int[] nums = {-1000000000,-1000000000,1000000000,-1000000000,-1000000000};
        int target = 294967296;
//        int[] nums = {1,0,-1,0,-2,2};
//        int target = 0;
        //排序
        Arrays.sort(nums);
        //找四个数
        List<List<Integer>> list1 = new ArrayList<>();
        int len = nums.length;
        for(int i = 0; i < len-3; i++) {
            if(target < 0 && nums[0] > 0) {
                break;
            }
            if(target > 0 && nums[len-1] < 0) {
                break;
            }
            //去重
            if(i != 0 && nums[i] == nums[i-1]) {
                continue;
            }
            for(int j = i+1; j < len-2; j++) {
                //去重
                if(j != i+1 && nums[j] == nums[j-1]) {
                    continue;
                }
                int left = j + 1;
                int right = len - 1;
                while(left < right) {
                    long sum = nums[left] + nums[right];
                    long tmp = target-nums[i]-nums[j];
                    if(sum > tmp) {
                        right--;
                    }else if(sum < tmp) {
                        left++;
                    }else {
                        List<Integer> list2 = new ArrayList<>();
                        list2.add(nums[i]);
                        list2.add(nums[j]);
                        list2.add(nums[left]);
                        list2.add(nums[right]);
                        list1.add(list2);
                        left++;
                        right--;
                        //去重
                        while(left < right && nums[left] == nums[left-1]) {
                            left++;
                        }
                        while(left < right && nums[right] == nums[right+1]) {
                            right--;
                        }
                    }
                }
            }
        }
        for(List<Integer> integerList : list1) {
            for(int a : integerList) {
                System.out.print(a + " ");
            }
            System.out.println();
        }
    }
    public static void main1(String[] args) {
        int a = Integer.parseInt("");
        System.out.println(a);
        String s = "";
        System.out.println(s);
    }
}
